import axios from '../AxiosConfig.js'

export const createAccount = data => {
    return axios({
        method: 'post',
        url: '/api/manage/account',
        data: data
    })
}

export const deleteAccount = ukId => {
    return axios({
        method: 'delete',
        url: '/api/manage/account',
        params: {"ukId": ukId}
    })
}

export const updateAccount = data => {
    return axios({
        method: 'put',
        url: '/api/manage/account',
        data: data
    })
}

export const listAccount = (username) => {
    return axios({
        method: 'get',
        url: '/api/manage/account/list',
        params: {"username": username}
    })
}

export const listAccountDetails = (username) => {
    return axios({
        method: 'get',
        url: '/api/manage/account/details/list',
        params: {"username": username}
    })
}


export const listAccountByOrgUkId = (orgUkId) => {
    return axios({
        method: 'get',
        url: '/api/manage/account/list/org',
        params: {"orgUkId": orgUkId}
    })
}


export const listAccountDetailsByOrgUkId = (orgUkId) => {
    return axios({
        method: 'get',
        url: '/api/manage/account/details/list/org',
        params: {"orgUkId": orgUkId}
    })
}

export const bandAccountRole = (accountUkId, roleUkIdList) => {
    return axios({
        method: 'put',
        url: '/api/manage/account/bind/role',
        data: {
            "accountUkId": accountUkId,
            "roleUkIdList": roleUkIdList
        }
    })
}




